var t = getApp();

Page({
    data: {
        member: {},
        ion: "",
        active: 0,
        isLoadMore: !1,
        loading: !1,
        listData: [],
        page: 1,
        last_page: 1
    },
    initData: function() {
        this.setData({
            page: 1,
            listData: [],
            isLoadMore: !1,
            loading: !0,
            last_page: null
        });
    },
    $toast: function(t) {
        wx.showToast({
            title: t,
            duration: 1e3,
            icon: "none"
        });
    },
    getdata: function() {
        var a = this;
        this.initData(), t._postNetWork({
            url: t.getNetAddresss("plugin.member-synchron.frontend.assets.income-list"),
            data: {
                page: this.data.page
            },
            success: function(t) {
                var e = t.data, s = e.result, n = e.msg, o = e.data;
                a.setData({
                    loading: !1
                }), 1 == s ? a.setData({
                    member: o.member,
                    ion: o.ion,
                    listData: o.income_list.data,
                    last_page: o.income_list.last_page,
                    isLoadMore: !(o.income_list.current_page == o.income_list.last_page)
                }) : a.$toast(n);
            }
        });
    },
    getMoreData: function() {
        var a = this;
        if (!this.data.isLoadMore) return this.$toast("没有更多了~~~");
        var e = this.data.page + 1;
        this.setData({
            loading: !0
        }), t._postNetWork({
            url: t.getNetAddresss("plugin.member-synchron.frontend.assets.income-list"),
            data: {
                page: e
            },
            success: function(t) {
                var s = t.data, n = s.result, o = s.msg, i = s.data;
                a.setData({
                    loading: !1
                }), 1 == n ? a.setData({
                    listData: a.data.listData.concat(i.income_list.data),
                    page: e,
                    isLoadMore: !(i.income_list.current_page == i.income_list.last_page)
                }) : a.$toast(o);
            }
        });
    },
    onLoad: function(t) {
        this.getdata();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.getMoreData();
    },
    onShareAppMessage: function() {}
});